#include "StdAfx.h"
#include "NTEngine/FileIO/InFile.h"
#include "NTEngine/FileIO/Manager.h"
#include "NTEngine/PseudoXml/PseudoXml.h"
#include "src/Tag.h"

namespace NTEngine {

namespace PseudoXml {

Document::Document( const char* fileName ) {
	FileIO::InFile inFile = FileIO::InFile::create( fileName );
	while ( !inFile.isFinished() ) {
		;
	}
	Tag tag( "Dummy" );
	m_Root = NEW Element( &tag, inFile.data() );
}

Element::Element( Tag* tag, const char* data ) {
}

} // namespace PseudoXml
} // namespace NTEngine
//#include "NTEngine/NTEngine.h"
//#include "NTEngine/PseudoXml/Document.h"
//#include "NTEngine/PseudoXml/Element.h"
//
//#include "src/AttributeImpl.h"
//#include "src/Tag.h"
//#include "src/ElementImpl.h"
//#include "src/DocumentImpl.h"
//#include <string>
//
//namespace NTEngine{
//namespace PseudoXml{
//using namespace std;
//
//Document Document::create(){
//	Document r;
//	r.mImpl = NEW Impl();
//	return r;
//}
//
//Document Document::create( const char* filename ){
//	Document r;
//	r.mImpl = NEW Impl();
//	r.mImpl->load( filename );
//	return r;
//}
//
//Document Document::create( const char* data, int size ){
//	Document r;
//	r.mImpl = NEW Impl();
//	r.mImpl->build( data, size );
//	return r;
//}
//
//void Document::write( const char* filename, bool isBinary ) const {
//	if ( isBinary ){
//		Array< char > out;
//		mImpl->convertToBinary( &out );
//		FileIO::Manager().write( 
//			filename, 
//			&out[ 0 ],
//			out.size() );
//	}else{
//		string out;
//		mImpl->convertToString( &out );
//		FileIO::Manager().write( 
//			filename, 
//			out.c_str(), 
//			static_cast< int >( out.size() ) );
//	}
//}
//
//void Document::convertToString( string* out ) const {
//	STRONG_ASSERT( mImpl && "This is Empty Object." );
//	mImpl->convertToString( out );
//}
//
//void Document::convertToBinary( Array< char >* out ) const {
//	STRONG_ASSERT( mImpl && "This is Empty Object." );
//	mImpl->convertToBinary( out );
//}
//
//Element Document::root(){
//	return Element( mImpl->root() );
//}
//
//ConstElement Document::root() const {
//	return Element( mImpl->root() );
//}
//
//bool Document::isReady(){
//	return ( mImpl && mImpl->isReady() );
//}
//
//bool Document::isError() const {
//	return ( mImpl && mImpl->isError() );
//}
//
//int Document::childNumber() const {
//	return mImpl->root()->childNumber();
//}
//
//Element Document::child( int i ){
//	return Element( mImpl->root()->child( i ) );
//}
//
//ConstElement Document::child( int i ) const {
//	return Element( mImpl->root()->child( i ) );
//}
//
//#define TYPE Document
//#include "GameLib/Base/Impl/ReferenceTypeTemplate.h"
//#define TYPE Document
//#define CONST_TYPE ConstDocument
//#include "GameLib/Base/Impl/ConstantTypeTemplate.h"
//
////ConstDocument
//ConstElement ConstDocument::root() const {
//	return mBase.root();
//}
//
//bool ConstDocument::isError() const {
//	return mBase.isError();
//}
//
//void ConstDocument::convertToString( string* out ) const {
//	mBase.convertToString( out );
//}
//
//void ConstDocument::convertToBinary( Array< char >* out ) const {
//	mBase.convertToBinary( out );
//}
//
//void ConstDocument::write( const char* filename, bool isBinary ) const {
//	mBase.write( filename, isBinary );
//}
//
//int ConstDocument::childNumber() const {
//	return mBase.childNumber();
//}
//
//ConstElement ConstDocument::child( int i ) const {
//	return mBase.child( i );
//}
//
//} //namespace PseudoXml
//} //namespace GameLib
